#!/bin/sh
# set -x
#
@copyright_hash@
#
# Launch script for dotgraph.
#
#------------------------------------------------------------
# Values from configure
#------------------------------------------------------------

@launch_script_vars@

# Relative paths are relative to HPCTOOLKIT.
ext_libs_dir='@hpc_ext_libs_dir@'
libexec_dir='libexec/hpctoolkit'

# Should be absolute path.
libcxx_path='@HPCRUN_LIBCXX_PATH@'

prog_name=dotgraph
binary_name=dotgraph-bin

#------------------------------------------------------------
# Find path to this script
#------------------------------------------------------------

hpc_path_to_root=../..
@export_hpctoolkit@

#------------------------------------------------------------
# Set environment and exec
#------------------------------------------------------------

@launch_early_options@

# Relative paths are relative to HPCTOOLKIT.
case "$ext_libs_dir" in
    /* ) ;;
    * )  ext_libs_dir="${HPCTOOLKIT}/${ext_libs_dir}" ;;
esac
case "$libexec_dir" in
    /* ) ;;
    * )  libexec_dir="${HPCTOOLKIT}/${libexec_dir}" ;;
esac

export LD_LIBRARY_PATH="${ext_libs_dir}:${libcxx_path}:${LD_LIBRARY_PATH}"
exec "${libexec_dir}/${binary_name}" "$@"
